package pl.ptemich.eav;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import pl.ptemich.eav.constants.WorldLimits;
import pl.ptemich.eav.states.PlatformGameState;
import pl.ptemich.tankwars.tools.LoggingTools;
import pl.ptemich.tankwars.tools.StateTools;

/**
 * @author AIPT
 * 
 */
public class EaVGame extends StateBasedGame {
  


  public EaVGame() {
    super("Elmo and Vermuth");
  }

  @Override
  public void initStatesList(GameContainer arg0) throws SlickException {
    LoggingTools.debug("init states");
    addState(new PlatformGameState());
  }

  /**
   * @param args
   */
  public static void main(String[] args) {
    AppGameContainer container;
    // Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    WorldLimits.SCREEN_WIDTH = 1024; //(int) screenSize.getWidth();
    WorldLimits.SCREEN_HEIGHT = 768; //(int) screenSize.getHeight();
    try {      
      EaVGame instance = new EaVGame();
      StateTools.registerGame(instance);
      container = new AppGameContainer(instance, WorldLimits.SCREEN_WIDTH, WorldLimits.SCREEN_HEIGHT, true);     
      
      container.setShowFPS(true);
      container.setTargetFrameRate(75);
      //container.setMouseGrabbed(true); // disable mouse cursor
      container.setVSync(true);
      container.start();
    } catch (SlickException e) {
      LoggingTools.error("application init failure");
    }

    LoggingTools.debug("Application end");
  }
  
}
